rest api docs page type

James Peret 10 年之前
父节点
当前提交
1900377cec
共有 6 个文件被更改,包括 32 次插入8 次删除
  1. 9 1
      app/data/page-list.json
  2. 9 0
      app/data/rest-api-v1/rest-getting-started.md
  3. 二进制
      app/scripts/.DS_Store
  4. 二进制
      app/scripts/libs/.DS_Store
  5. 2 4
      app/views/realtime-api-v1.html
  6. 12 3
      app/views/rest-api-v1.html

+ 9 - 1
app/data/page-list.json

@@ -24,6 +24,14 @@
24 24
   "rest-api-v1" :
25 25
     [
26 26
       {
27
+        "pageUrl" : "/rest-api-v1/rest-getting-started",
28
+        "slug"  : "rest-getting-started",
29
+        "title" : "Rest API v1",
30
+        "type"  : "page",
31
+        "content" : "data/rest-api-v1/rest-getting-started.md",
32
+        "tagline" : "Getting started guide"
33
+      },
34
+      {
27 35
         "pageUrl" : "/rest-api-v1/get-missions",
28 36
         "slug"  : "get-missions",
29 37
         "title" : "Mission List",
@@ -71,7 +79,7 @@
71 79
           "type" : "GET",
72 80
           "base" : "/missions/:slug"
73 81
         },
74
-        "implemented" : true,
82
+        "implemented" : false,
75 83
         "description" : "Returns detailed information about a mission, including lists of all agents, all tasks and recent activity.",
76 84
         "variables" : [
77 85
           {

+ 9 - 0
app/data/rest-api-v1/rest-getting-started.md

@@ -0,0 +1,9 @@
1
+Avalanche Network uses a *restfull API* to communicate with other apps. The *API* entry point can be found in the following url:
2
+
3
+    http://avalanche.network/api/
4
+
5
+Some of the *endpoints* are public, depending on the data being queried. Other *endpoints* require authentication. An example public *endpoint* is:
6
+
7
+    http://avalanche.network/api/missions
8
+
9
+Accessing the URL above will return a *JSON* file with the last 10 public launched missions on the Avalanche Network database.

二进制
app/scripts/.DS_Store


二进制
app/scripts/libs/.DS_Store


+ 2 - 4
app/views/realtime-api-v1.html

@@ -69,10 +69,8 @@
69 69
             </div>
70 70
           </div>
71 71
       </div>
72
-
73
-
74
-
75
-
72
+    </div>
73
+    <div>
76 74
     </div>
77 75
   </div>
78 76
 </div>

+ 12 - 3
app/views/rest-api-v1.html

@@ -5,15 +5,19 @@
5 5
       <ul class="nav nav-sidebar">
6 6
         <li ng-repeat="page in pageList" ng-class="{ active: isActive(page.pageUrl)}">
7 7
           <a ui-sref="rest-api-v1({ id: page.slug })">
8
-            <small class="api-endpoint"><span ng-class="callTypeBadge(page.endpoint.type)">{{page.endpoint.type}}</span><samp>{{page.endpoint.base}}</samp></small>
9
-            <p class="endpoint-description"><i>{{page.title}}</i></p>
8
+            <small ng-hide="page.type == 'page'" class="api-endpoint">
9
+              <span ng-class="callTypeBadge(page.endpoint.type)">{{page.endpoint.type}}</span><samp>{{page.endpoint.base}}</samp>
10
+            </small>
11
+            <p  ng-hide="page.type == 'page'" class="endpoint-description"><i>{{page.title}}</i></p>
12
+            <h5 ng-show="page.type == 'page'">{{page.title}}</h5>
13
+            <p  ng-show="page.type == 'page'" style="margin-bottom: 10px;"><i>{{page.tagline}}</i></p>
10 14
           </a>
11 15
         </li>
12 16
 
13 17
       </ul>
14 18
     </div>
15 19
     <div class="col-sm-5 col-sm-offset-7 col-md-7 col-md-offset-5 main">
16
-      <div class="api-endpoint">
20
+      <div class="api-endpoint" ng-hide="pageData.type == 'page'">
17 21
         <h2 style="margin-bottom: 0px;">{{pageData.title}}</h2>
18 22
         <small class="api-endpoint"><span ng-class="callTypeBadge(pageData.endpoint.type)">{{pageData.endpoint.type}}</span> {{pageData.endpoint.base}}</small>
19 23
         <hr>
@@ -61,5 +65,10 @@
61 65
         </div>
62 66
 
63 67
     </div>
68
+    <div ng-show="pageData.type == 'page'">
69
+      <h2 style="margin-bottom: 0px;">{{pageData.title}}</h2>
70
+      <hr>
71
+      <div btf-markdown ng-include="pageData.content"></div>
72
+    </div>
64 73
   </div>
65 74
 </div>